Skip to content

test: migrate the tests to Testo on cycle/testing - #52

Merged
roxblnfk merged 14 commits into
1.xfrom
test/testo
Nov 20, 2026
Merged

roxblnfk merged 14 commits into
1.xfrom
test/testo

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

What was changed

  • The tests run on Testo through the shared cycle/testing harness (^0.1.1, from its VCS repository until it reaches Packagist) instead of PHPUnit. testo.php declares a Unit suite and Feature/<Driver> and Regression/<Driver> suites for SQLite, MySQL, Postgres and SQLServer.
  • tests/Behavior/Functional/Driver/Common moved to tests/Feature/Common, which cycle/testing runs against every driver; unit tests live in tests/Unit. DatabaseTestCase / OrmTestCase and the SimpleContainer of cycle/testing replace the copied base classes and utilities; ListenerTestCase, SchemaTestCase and IntegrationTestCase stay in tests/Support.
  • Composer scripts: test, test:unit, test:<driver>, plus db:up / db:down for the databases from the cycle/testing compose file. composer test:new-case -- <N> writes a runnable regression case into tests/Regression/Issue<N> from the orm-behaviors template of cycle/testing.
  • CI: .github/workflows/testing.yml calls the shared cycle/gh-actions Testo workflow with coverage on. Unit and SQLite run on PHP 8.2–8.6 with highest dependencies and on 8.2 with lowest; MySQL, Postgres and SQLServer run on PHP 8.2 and 8.6 (highest, plus lowest on 8.2); every job runs with DB_REQUIRED=1, so an unreachable database fails the job instead of skipping; coverage goes to Codecov with one flag per suite. It replaces main.yml (Unit + SQLite, coverage on every driver) and ci-mysql.yml, ci-pgsql.yml, ci-mssql.yml.
Suite PHPUnit baseline Testo
Unit 122 tests 122 tests
SQLite 52 tests (driver-sqlite) 49 Feature
MySQL / Postgres / SQLServer 52 each (listed) 49 Feature each
  • Deliberate difference: the 3 missing tests are the CaseTemplate sample case, which is gone together with tests/generate-case.php; the generated case runs the same 3 tests. JUnit results of the SQLite and Unit runs match the PHPUnit ones test by test.
  • Deleted: PHPUnit, phpunit.xml, tests/bootstrap.php, tests/docker-compose.yml, the stub generator tests/generate.php and the per-driver stubs it produced, BaseTest, BaseListenerTest, TableTrait, Loggable, TableRenderer, TestLogger and the local SimpleContainer.

Why?

One harness for all Cycle packages: databases, the driver matrix and isolation come from cycle/testing instead of per-repo copies.

Checklist

  • Tested
    • Unit and SQLite suites run locally
    • MySQL, Postgres and SQLServer suites run in CI
    • Unit tests added

cycle/testing runs each Feature/Common class against every driver, so the generator of per-driver subclasses has nothing left to produce.

Assisted-By: Claude Opus 5.5 <[email protected]>
A mechanical pass kept apart from the harness move, so the hand-made changes review on their own.

Assisted-By: Claude Opus 5.5 <[email protected]>
DatabaseTestCase and OrmTestCase of cycle/testing replace the copied BaseTest, TableTrait, Loggable, TableRenderer and TestLogger; ListenerTestCase, SchemaTestCase and IntegrationTestCase stay in tests/Support as helpers specific to this package.

Assisted-By: Claude Opus 5.5 <[email protected]>
PHPUnit and the Rector bridge are no longer used once every test runs on Testo.

Assisted-By: Claude Opus 5.5 <[email protected]>
The package compose file waits for the database itself, and DB_REQUIRED=1 makes an unreachable database fail the job instead of skipping its tests.

Assisted-By: Claude Opus 5.5 <[email protected]>
@roxblnfk
roxblnfk requested a review from a team November 20, 2026 11:58
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.97%. Comparing base (79f0568) to head (0c4f0b8).

❗ There is a different number of reports uploaded between BASE (79f0568) and HEAD (0c4f0b8). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (79f0568) HEAD (0c4f0b8)
4 0
Additional details and impacted files
@@             Coverage Diff              @@
##                1.x      #52      +/-   ##
============================================
- Coverage     83.20%   77.97%   -5.23%     
============================================
  Files            20       20              
  Lines           512      445      -67     
============================================
- Hits            426      347      -79     
- Misses           86       98      +12     
Flag Coverage Δ
mysql 82.93% <ø> (?)
postgres 82.93% <ø> (?)
sqlite 82.93% <ø> (?)
sqlserver 82.93% <ø> (?)
unit 3.33% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The PHPUnit coverage job ran all drivers, so a SQLite-only run drops the lines only the server drivers reach.

Assisted-By: Claude Opus 5.5 <[email protected]>
The orm-behaviors template of cycle/testing replaces the local CaseTemplate and its copy script.

Assisted-By: Claude Opus 5.5 <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]>
@roxblnfk
roxblnfk merged commit 8c570cb into 1.x Nov 20, 2026
20 of 22 checks passed
@roxblnfk
roxblnfk deleted the test/testo branch November 20, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant